<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

//use Illuminate\Support\Facades\Schema;

class AddDiyFormTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('diy_form', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('名称');
            $table->longText('content')->nullable()->comment('内容');
            $table->string('img')->default('')->comment('图片');
            $table->tinyInteger('status')->default(1)->comment('状态 0-禁用 1-正常');
            $table->string('mini_type')->index()->comment('小程序类型');
            $table->text('config')->comment('表单配置');
            $table->timestamps();
            $table->comment = '自定义表单表';
        });

        Schema::create('diy_form_content', function (Blueprint $table) {
            $table->id();
            $table->integer('diy_form_id')->index()->comment('自定义表单id');
            $table->string('diy_form_name')->comment('自定义表单名称');
            $table->string('diy_form_img')->default('')->comment('自定义表单图片');
            $table->integer('member_id')->index()->comment('会员id');
            $table->string('mini_type')->index()->comment('小程序类型');
            $table->text('content')->comment('表单内容');
            $table->timestamps();
            $table->comment = '自定义表单提交内容表';
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
